import request from '@neu/biz-core/utils/request'
const baseUrl = 'dcam/api/w/process/outbound'

export const start = (processKey, isComplete, data) => {
  return request({
    url: baseUrl + '/start/' + processKey + '/' + isComplete,
    data,
    method: 'post'
  })
}

export const detail = (code) => {
  return request({
    url: baseUrl + '/' + code,
    method: 'get'
  })
}

export const submit = (code, data) => {
  return request({
    url: baseUrl + '/submit/' + code,
    data,
    method: 'put'
  })
}

export const remove = (code) => {
  return request({
    url: baseUrl + '/' + code,
    method: 'delete'
  })
}

export const processImage = (code) => {
  return request({
    url: baseUrl + '/img/' + code,
    method: 'get',
    responseType: 'blob'
  })
}

export const approve = (code, data) => {
  return request({
    url: baseUrl + '/approve/' + code,
    data,
    method: 'post'
  })
}

export const toBack = (code, data) => {
  return request({
    url: baseUrl + '/finish/' + code,
    data,
    method: 'post'
  })
}

export const history = (code) => {
  return request({
    url: baseUrl + '/history/' + code,
    method: 'get'
  })
}
